package com.spring.takeaway.controller;

import com.spring.takeaway.dao.MerchantDao;
import com.spring.takeaway.po.MerChant;
import com.spring.takeaway.service.MerChantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author LCD
 * @Date 2022/6/11 14:35
 **/
@RestController
public class MerchantController {


    @Autowired
    private MerChantService merChantService;


    @GetMapping("/getMerchant/{k}")
    public List<MerChant> getList(@PathVariable int k){

        return this.merChantService.findListMerChant(k);

    }

    @GetMapping("/getSearch/{keyWord}")
    public List<MerChant>getMerchant(@PathVariable String keyWord){
        return this.merChantService.SearchMerchant(keyWord);
    }

}
